// pages/myorder/orderlist/orderlist.js
var e = getApp(), a = e.require("/utils/util.js"), t = e.require("/utils/api.js"), n = e.require("/utils/enums.js"), r = e.require("/utils/onfire.js");

Page({

  /**
   * 页面的初始数据
   */
  data: {
    current: 'tab1',
    tabs: [
      {
        key: '0',
        title: '我跑腿的',
        content: 'Content of tab 0',
      },
      {
        key: '1',
        title: '我发起的',
        content: 'Content of tab 2',
      }
    ],
    orders: [
      {
        NickName: 'Jason',
        avatar: 'https://wx.qlogo.cn/mmopen/vi_32/WIcg3v0WezniaA3Np7xm4aFMV8e1IyGIFJQupNZe3fWTW8daCUzL02ibib2HjlQTtCEFroPOCPJ3kLyVBHA0micguA/132',
        Type: 2,
        Status: 0,
        ShopLogoSrc: 'aaaaa',
        ShopName: '扬州炒饭',
        Money: 10,
        CommodityNames: '说明备注',
        Remark: '需要帮忙跑腿的内容',
        MoneyFreight: 1,
        MoneyTip: 1,
        CreatedTime: '2018-11-12 11:45:12'
      },

      {
        NickName: 'Jason',
        avatar: 'https://wx.qlogo.cn/mmopen/vi_32/WIcg3v0WezniaA3Np7xm4aFMV8e1IyGIFJQupNZe3fWTW8daCUzL02ibib2HjlQTtCEFroPOCPJ3kLyVBHA0micguA/132',
        Type: 2,
        Status: 0,
        ShopLogoSrc: 'aaaaa',
        ShopName: 'dddddd',
        Money: 3,
        CommodityNames: 'ffffffffffff',
        Remark: '需要帮忙跑腿的内容',
        MoneyFreight: 2,
        MoneyTip: 1,
        CreatedTime: '2018-11-12 11:45:12'
      },

      {
        NickName: 'Jason', avatar: 'https://wx.qlogo.cn/mmopen/vi_32/WIcg3v0WezniaA3Np7xm4aFMV8e1IyGIFJQupNZe3fWTW8daCUzL02ibib2HjlQTtCEFroPOCPJ3kLyVBHA0micguA/132',
        Type: 2,
        Status: 0,
        ShopLogoSrc: '',
        ShopName: 'dddddd',
        Money: 3,
        CommodityNames: 'ffffffffffff',
        Remark: '需要帮忙跑腿的内容',
        MoneyFreight: 2,
        MoneyTip: 1,
        CreatedTime: '2018-11-12 11:45:12'
      },

      {
        NickName: 'Jason',
        avatar: 'https://wx.qlogo.cn/mmopen/vi_32/WIcg3v0WezniaA3Np7xm4aFMV8e1IyGIFJQupNZe3fWTW8daCUzL02ibib2HjlQTtCEFroPOCPJ3kLyVBHA0micguA/132',
        Type: 2,
        Status: 0,
        ShopLogoSrc: '',
        ShopName: 'dddddd',
        Money: 3,
        CommodityNames: 'ffffffffffff',
        Remark: '需要帮忙跑腿的内容',
        MoneyFreight: 2,
        MoneyTip: 1,
        CreatedTime: '2018-11-12 11:45:12'
      }
    ]
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    console.log('orderlist');
  },

  onChange(e) {
    // console.log('onChange', e)
    this.setData({
      current: e.detail.key,
    })
  },

  onTabsChange(e) {
    // console.log('onTabsChange', e)
    const { key } = e.detail
    const index = this.data.tabs.map((n) => n.key).indexOf(key)

    this.setData({
      key,
      index,
    })
  },

  onSwiperChange(e) {
    // console.log('onSwiperChange', e)
    const { current: index, source } = e.detail
    const { key } = this.data.tabs[index]

    if (!!source) {
      this.setData({
        key,
        index,
      })
    }
  },

})